package com.sxit.tdf.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sxit.tdf.server.entity.File;
import com.sxit.tdf.server.entity.bo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

/**
 * Mapper 接口
 *
 * @author 橙子高
 * @since 2022-02-23
 */
@Mapper
public interface FileMapper extends BaseMapper<File> {

  List<FileInfoBo> getAllFileInfo(
      Page<FileInfoBo> page,
      @Param("pathCode") String pathCode,
      @Param("bucketName") String bucketName,
      @Param("fileSuffix") String fileSuffix,
      @Param("fileOwnUserName") String fileOwnUserName,
      @Param("fileName") String fileName);

  Boolean isCanInsert(
      @Param("fileName") String fileName,
      @Param("originalFilename") String originalFilename,
      @Param("filePathId") Integer filePathId);

  List<String> getSuffix();

  List<SimpleFileStoreInfo> getStoreFileInfo(@Param("ids") List<Integer> ids);

  StoreFileInfoBo getStoreFileById(String id);

  void addFileDownload(@Param("id") String id);

  Long getFileCount();

  Long selectCountByType(@Param("type") Integer type);

  Long getFileDownLoadNumber();

  Long getfileUploadNumber();

  List<fileIncrement> getFileIncrementList();

  List<fileTypeNumber> getFileTypeNumberList();

  List<fileStoreNumber> getFileStoreNumberList();

  IPage<ComplexFileDataBo> getComplexFileInfo(
      Page<ComplexFileDataBo> page, @Param("map") HashMap map);

  List<String> getALLSuffix();

  List<PrivateFileListBo> getPrivateFileList(@Param("userId") String userId);

  Long selectCountApprover(@Param("userId") String userId);

  Long getCountRefult(@Param("userId") String userId);
}
